package com.lbj.util;

import java.util.List;

//带泛型的类
public class PageBean<T> {
	private int pageNo = 1;
	private int pageSize = 8;
	private int totalCount;
	private int totalPageCount;
	private List<T> pageList;
	public int getPageNo() {
		return pageNo;
	}
	public void setPageNo(int pageNo) {
		if (pageNo<1) {
			this.pageNo=1;
		}else if (pageNo>totalPageCount&&totalPageCount>0) {
			this.pageNo=totalPageCount;
		}else{
			this.pageNo = pageNo;
		}
		
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
		totalPageCount = totalCount % pageSize == 0 ? totalCount/pageSize : totalCount/pageSize+1;
	}
	public int getTotalPageCount() {
		return totalPageCount;
	}
	public List<T> getPageList() {
		return pageList;
	}
	public void setPageList(List<T> pageList) {
		this.pageList = pageList;
	}
}
